﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DeadInventoryReport.aspx.cs" Inherits="MLY.Reports.SCCoverReports.DeadInventoryReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Dead inventory report</title>
    <style type="text/css">
        .TitleStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:14px;
            font-weight:bold;
            color:Black;
        }
        .InerTextStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:12px;
            color:Black;
        }
        
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:PostBackTrigger ControlID="ExportImageButton" />
        </Triggers>
        <ContentTemplate>
            <asp:HiddenField ID="IsClientHiddenField" runat="server" />
            <asp:Label ID="PageTitlePanel" runat="server" Text="Dead inventory report" CssClass="TitleStyle"></asp:Label>
            <br /><br />
            <table cellspacing="0" cellpadding="5">
            <tr>
            <td>
                <asp:Label ID="SendDateTitleLabel" runat="server" CssClass="InerTextStyle" 
                Text="Send date from: "></asp:Label>
            </td>
            <td>
                <KBMControls:KBMReadOnlyTxtBox runat="server" ID="txtFromDate"></KBMControls:KBMReadOnlyTxtBox>
                <KBMValidators:requiredValidator ID="txtFromDateRequiredValidator" runat="server" 
                ControlToValidate="txtFromDate" ErrorMessage="Please choose send date">
                </KBMValidators:requiredValidator>
                <KBMControls:KbmCalendar TargetControlID="txtFromDate" runat="server" ID="KbmCalendar1">
                </KBMControls:KbmCalendar>
            </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="OrganizationsTitleLabel" runat="server" CssClass="InerTextStyle"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddlOrgs" runat="server" DataTextField="OrganizationName"
                    DataValueField="OrganizationId" >
                </asp:DropDownList>
            </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="ContractorWONTitleLabel" runat="server" CssClass="InerTextStyle" Text="Specify contractor work order number: "></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="ContractorWONTextBox" runat="server" MaxLength="50" Width="100"></asp:TextBox>
            </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="CustomerWONTitleLabel" runat="server" CssClass="InerTextStyle" Text="Specify customer work order number: "></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="CustomerWONTextBox" runat="server" MaxLength="50" Width="100"></asp:TextBox>
            </td>
            </tr>
            </table>
            <br />
            <asp:Button ID="GenerateReportButton" runat="server" Text="Generate report" OnClick="GenerateReportClick" />
            <asp:UpdateProgress AssociatedUpdatePanelID="UpdatePanel1" ID="UpdateProgress1" runat="server">
                <ProgressTemplate>
                    Loading...
                </ProgressTemplate>
            </asp:UpdateProgress>
            <br /><hr /><br />
            <asp:ImageButton ID="ExportImageButton" runat="server" ImageUrl="~/Images/excel.gif"
                 OnClick="ExportToExcel" ToolTip="Export to csv file" />
             <asp:GridView ID="ReportGridview" runat="server" AutoGenerateColumns="false" AllowPaging="false">
             <HeaderStyle BackColor="#86C2FF" />
             <RowStyle CssClass="InerTextStyle" />
             <Columns>
                <asp:BoundField DataField="ContractorOrganizationName" HeaderText="Contractor"  />
                <asp:BoundField DataField="CustomerOrganizationName" HeaderText="Customer" />
                <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="Customer work order number" />
                <asp:BoundField DataField="ContractorWorkOrderNumber" HeaderText="Contractor work order number" />
                <asp:BoundField DataField="ContractorLotNumber" HeaderText="Supplier lot number" />
                <asp:BoundField DataField="SendDate" HeaderText="Send Date" />
                <asp:BoundField DataField="RequestedDelivaryDate" HeaderText="Requested delivery date" />
                <asp:BoundField DataField="PlannedDelivaryDate" HeaderText="Planned delivery date" />
                <asp:BoundField DataField="CustomerPriority" HeaderText="Priority" />
                <asp:BoundField DataField="Quantity" HeaderText="Quantity" />
                <asp:BoundField DataField="originalQuantity" HeaderText="Original quantity" />
                <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="Customer Catalouge Code" />
                <asp:BoundField DataField="ContractorCatalogueCode" HeaderText="Contractor catalogue code" />
                <asp:BoundField DataField="ProductDescription" HeaderText="Product description" />
                <asp:BoundField DataField="Remarks" HeaderText="Remarks" />
                <asp:BoundField DataField="OrderNumber" HeaderText="Order number" />
                <asp:BoundField DataField="SplitId" HeaderText="Split Id" />
             </Columns>
             <EmptyDataTemplate>
                <div class="InerTextStyle">No items matching the request detected</div>
             </EmptyDataTemplate>
             </asp:GridView>
            
            <asp:SqlDataSource ID="ReportDataSource" runat="server" SelectCommandType="StoredProcedure"
            ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" 
            SelectCommand="SCCover_Reports_DeadInventory"></asp:SqlDataSource> 
        </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
